import { action } from 'mobx';
import { fromJS } from 'immutable'

export const initialState = fromJS({
    num: 3000,
    collapsed: false,
})

export const reducers = (state: any, action: any) => {
    const { type, payload } = action

    switch (type) {
        case "COUNTADD":
            return state.updated('num', (x: any) => x + 1)
            break;
        case "CHANGECOLLAPSED":
            return
            state.set('collapsed', payload)
            break;


        default:
            return state;
            break;
    }
}